package com.example.android;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.android.databinding.ActivityExamBinding;

public class ExamActivity extends AppCompatActivity implements View.OnClickListener {

    ActivityExamBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityExamBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        binding.btn1.setOnClickListener(this);
        binding.btn2.setOnClickListener(this);
        binding.btn3.setOnClickListener(this);
        binding.btn4.setOnClickListener(this);
        
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btn1:
                jump2Activity(MainActivity.class);
                break;
            case R.id.btn2:
                jump2Activity(Activity2.class);
                break;
            case R.id.btn3:
                break;
            case R.id.btn4:
                jump2Activity(Activity4.class);
                break;
        }
    }

    private void jump2Activity(Class<? extends AppCompatActivity> clazz) {
        Intent intent = new Intent(this,clazz);
        startActivity(intent);
    }
}